import type { PageDto, PageReqDto } from '@/api/types'
import request from '@/utils/request'
import type { InsurePeriodServeCompanyDto } from '../serveCompany/types'
import type { InsureAgentCompanyDto } from './types'

export function getAgentServeCompanyList(params: PageReqDto) {
    return request.get('/crm-prod-v2/web/pc/crm/insureAgentPeriodServeCompany/queryPageList', {
        params
    }) as Promise<PageDto<InsurePeriodServeCompanyDto[]>>
}

export function getAgentCustomerCompanyList(params: PageReqDto & {
    companyId?: number
    insureType?: number
    companyName?: string
}): Promise<PageDto<InsureAgentCompanyDto[]>> {
    return request.get('/crm-prod-v2/web/insureAgentCompany/list', {
        params
    })
}